<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        input {
            width: 200px;
            height: 20px;
            color: #999;
            border: 1px solid #888;
            outline: none;
        }
    </style>
</head>
<body>
    <input type="text" value="邮箱/ID/手机号">
    <!-- 要求：点击文本框隐藏里面的文字且文本框颜色改变为粉色 -->
    <script>
        // 获取元素
        var ipt = document.querySelector('input');
        // 注册事件 获得焦点
        ipt.onfocus = function() {
            if(this.value === '邮箱/ID/手机号') {
                this.value = '';
            } 
            this.style.color = '#333';
            this.style.borderColor = 'pink';
        }
        // 失去焦点
        ipt.onblur = function() {
            if (this.value === '') {
                this.value = '邮箱/ID/手机号';
                
            }
            this.style.color = '#999';
            this.style.borderColor = '#888';
            
        }
    </script>
</body>
</html>